package com.geeksaga.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.geeksaga.dao.TableRowCountDao;
import com.geeksaga.domain.TableRowCount;

/**
 * @author newbie, casper
 * @since 0.1
 */
@Service
public class TableRowCountServiceImpl implements TableRowCountService {
    @Autowired private TableRowCountDao tableRowCountDao;
    
    /* (non-Javadoc)
     * @see com.geeksaga.service.TableRowCountService#plusRowCount(com.geeksaga.domain.TableRowCount)
     */
    public int plusRowCount(TableRowCount tableRowCount) throws DataAccessException {
    	return tableRowCountDao.plusTotalCount(tableRowCount);
    }
    
    /* (non-Javadoc)
     * @see com.geeksaga.service.TableRowCountService#minusRowCount(com.geeksaga.domain.TableRowCount)
     */
    public int minusRowCount(TableRowCount tableRowCount) throws DataAccessException {
    	return tableRowCountDao.minusTotalCount(tableRowCount);
    }

	/* (non-Javadoc)
	 * @see com.geeksaga.service.TableRowCountService#addTableRowCountDao(com.geeksaga.domain.TableRowCount)
	 */
	public TableRowCount addTableRowCountDao(TableRowCount tableRowCount)
			throws DataAccessException {
		return tableRowCountDao.addTableRowCountDao(tableRowCount);
	}
	
    /* (non-Javadoc)
     * @see com.geeksaga.service.TableRowCountService#count(java.util.Map, java.lang.String)
     */
    public TableRowCount count(Map<String, Object> parameter, String table) throws DataAccessException {
        return tableRowCountDao.count(parameter, table);
    }
}